package example.method.p13.ex01;

/**
 * @author 17976
 */
public class Main {
    public static void main(String[] args) {
        int[] intary={1,2,3,4};
        forDisaplay(intary);
        foreachDiasplay(intary);
    }
    public static void forDisaplay(int[] a){
        System.out.println("使用for循环数组");
        for(int i=0;i<a.length;i++){
            System.out.println(a[i]+" ");
        }
        System.out.println();
    }
    public static void foreachDiasplay(int[] data){
        System.out.println("使用foreach循环数组");
        for(int a : data){
            System.out.println(a+" ");
        }
    }
}
